<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;

class IllustratedHandbookController extends BaseController
{
    /**
     * 构造函数
     *
     * @param Request $request
     */
    public function __construct(Request $request)
    {
        parent::__construct($request);
    }

    /**
     * 获取等级边框
     */
    public function getFrameImages()
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/get_frame_images'));
    }

    /**
     * 设置等级边框
     *
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function setFrameImages(Request $request)
    {
        $params = $request->input();
        $result = callKKAudioApi('inner/illustrated_handbook/update_frame_images', $params);
        if ($result['code'] == 0) {
            return $this->toJson(self::SUCCESS);
        }

        return $this->toJson(self::ERROR, [], $result['msg']);
    }

    /**
     * 获取主题列表
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function getTopics()
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/get_topics'));
    }

    /**
     * 添加主题
     *
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function addTopic(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/add', $request->all()));
    }

    /**
     * 编辑主题
     *
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function editTopic(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/update', $request->all()));
    }

    /**
     * 获取礼物列表
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function getGifts()
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/get_gifts'));
    }

    /**
     * 添加图鉴礼物
     *
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function addGift(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/add_gift', $request->all()));
    }

    /**
     * 获取图鉴列表
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function getIllustratedHandbooks(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/get_illustrated_handbooks', $request->all()));
    }

    /**
     * 删除礼物
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function deleteGift(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/delete_gift', $request->all()));
    }

    /**
     * 更新礼物
     *
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function editGift(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/update_gift', $request->all()));
    }

    /**
     * 获取特定标签
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function getLabels()
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/label_names'));
    }

    /**
     * 获取守护标签
     *
     * Created at 2021/11/10 11:54
     * @Author <yuxiang.zhu@asiainnovations.net>
     * @return \Illuminate\Http\JsonResponse
     */
    public function getGuardTags()
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/get_guard_tags'));
    }

    /**
     * 添加守护标签
     *
     * Created at 2021/11/10 11:55
     * @Author <yuxiang.zhu@asiainnovations.net>
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function addGuardTag(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/add_guard_tag', $request->all()));
    }

    /**
     * 编辑守护标签
     *
     * Created at 2021/11/10 11:55
     * @Author <yuxiang.zhu@asiainnovations.net>
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function editGuardTag(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/edit_guard_tag', $request->all()));
    }

    /**
     * 删除守护标签
     *
     * Created at 2021/11/10 11:55
     * @Author <yuxiang.zhu@asiainnovations.net>
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function deleteGuardTag(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/delete_guard_tag', $request->all()));
    }

    /**
     * 添加任务
     *
     * Created at 2021/11/10 15:25
     * @Author <yuxiang.zhu@asiainnovations.net>
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function addAchievement(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/add_achievement', $request->all()));
    }

    /**
     * 编辑任务
     *
     * Created at 2021/11/10 15:25
     * @Author <yuxiang.zhu@asiainnovations.net>
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function editAchievement(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/edit_achievement', $request->all()));
    }

    /**
     * 删除任务
     *
     * Created at 2021/11/10 15:25
     * @Author <yuxiang.zhu@asiainnovations.net>
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function deleteAchievement(Request $request)
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/delete_achievement', $request->all()));
    }

    /**
     * 获取任务列表
     *
     * Created at 2021/11/10 15:25
     * @Author <yuxiang.zhu@asiainnovations.net>
     * @return \Illuminate\Http\JsonResponse
     */
    public function getAchievementList()
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/get_achievement_list'));
    }

    /**
     * 获取任务类型
     *
     * Created at 2021/11/10 17:17
     * @Author <yuxiang.zhu@asiainnovations.net>
     * @return \Illuminate\Http\JsonResponse
     */
    public function getAchievementTypes()
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/get_achievement_types'));
    }

    /**
     * 获取任务分类
     *
     * Created at 2022/11/17
     * @Author sulong
     * @return \Illuminate\Http\JsonResponse
     */
    public function getAchievementClass()
    {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/get_achievement_class'));
    }

    /**
     * 等级边框列表
     *
     * Created at 2022/11/23
     * @Author sulong
     * @return \Illuminate\Http\JsonResponse
     */
    public function frameImagesList() {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/frame_images_list'));
    }

    /**
     * 等级边框新增
     *
     * Created at 2022/11/23
     * @Author sulong
     * @return \Illuminate\Http\JsonResponse
     */
    public function frameImagesAdd(Request $request) {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/frame_images_create_or_update', $request->all()));
    }

    /**
     * 等级边框修改
     *
     * Created at 2022/11/23
     * @Author sulong
     * @return \Illuminate\Http\JsonResponse
     */
    public function frameImagesUpdate(Request $request) {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/frame_images_create_or_update', $request->all()));
    }

    /**
     * 获取图鉴配置
     *
     * Created at 2022/11/23
     * @Author sulong
     * @return \Illuminate\Http\JsonResponse
     */
    public function getIllustrateConfig() {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/get_illustrated_config'));
    }

    /**
     * 设置图鉴配置
     *
     * Created at 2022/11/23
     * @Author sulong
     * @return \Illuminate\Http\JsonResponse
     */
    public function setIllustrateConfig(Request $request) {
        return $this->parseApiResult(callKKAudioApi('inner/illustrated_handbook/set_illustrated_config', $request->all()));
    }

}
